home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / mips-sgi-irix6.2 / tm-html.z / tm-html
Encoding:
Text File  |  1998-05-21  |  1.6 KB  |  63 lines

  1. #!/bin/sh
  2. #
  3. # $Id: tm-html,v 5.0 1997/01/10 14:51:59 morioka Exp $
  4. #
  5. # Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. # You should have received a copy of the GNU General Public License
  16. # along with GNU Emacs; see the file COPYING.  If not, write to the
  17. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. # Boston, MA 02111-1307, USA.
  19.  
  20. PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
  21.  
  22. if [ "$TM_TMP_DIR" = "" ]; then
  23.     TM_TMP_DIR=/tmp
  24.     export TM_TMP_DIR
  25. fi
  26.  
  27. if [ "$TM_WWW_BROWSER" = "" ]; then
  28.     TM_WWW_BROWSER=netscape
  29.     export TM_WWW_BROWSER
  30. fi
  31.  
  32. if [ "$5" = "" ]; then
  33.     filename="$TM_TMP_DIR/mime$$.html"
  34. else
  35.     filename="$TM_TMP_DIR/$5"
  36. fi
  37.  
  38. echo "$2; $3 -> $filename"
  39.  
  40. tmdecode "$3" $1 $filename
  41.  
  42. case "$4" in
  43. "play")
  44.     if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then
  45.     echo netscape
  46.     if [ -h $HOME/.netscape/lock ]; then
  47.         netscape -remote "openURL(file:$filename,new-window)"
  48.         else
  49.         netscape $filename
  50.         fi
  51.     else
  52.     echo not netscape
  53.     $TM_WWW_BROWSER $filename
  54.     fi
  55.     trap 'rm -f $filename' 0 1 2 3 13 15
  56.     ;;
  57. "extract")
  58.     echo "extract to $filename"
  59.     ;;
  60. esac
  61.